from django.db import models
from django.contrib.auth.models import User

class Player(models.Model):
    user = models.OneToOneField(User,on_delete=models.CASCADE)
    # 在删除User以后Player也一起删除
    photo = models.URLField(max_length=256,blank=True)
    # 数据库图片
    openid = models.CharField(default="", max_length=50, blank=True,null=True)

    score = models.IntegerField(default = 1500)
    def __str__(self):
        return str(self.user)
